/*
 * Copyright (c) 2019. ascend 版权所有禁止转载。
 */

package cn.edu.zua.demo16.controller;

import cn.edu.zua.demo16.entity.TestUserEntity;
import cn.edu.zua.demo16.jpa.TestUserJpa;
import cn.edu.zua.demo16.service.TestUserServiceImpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 说明：
 *
 * @author ascend
 * 2019/1/28 10:52
 */
@RestController
@RequestMapping("/user")
public class TestUserController {
    private TestUserJpa userJPA;
    private TestUserServiceImpl userService;

    public TestUserController(TestUserJpa userJPA, TestUserServiceImpl userService) {
        this.userJPA = userJPA;
        this.userService = userService;
    }

    @GetMapping("/list")
    public List<TestUserEntity> list() {
        return userJPA.findAll();
    }

    @GetMapping("/list2")
    public List<TestUserEntity> list2() {
        return userService.list();
    }

}
